Текст |
Расположение в меню |
---|
Annotation → Текст |
Верстаки |
Draft, Arch |
Быстрые клавиши |
T E |
Представлено в версии |
0.7 |
См. также |
Метка, Фигура из текста |
Инструмент Текст позволяет добавить в документ многострочную текстовую область в указанную точку. Он использует предварительно выбранный Draft Linestyle, установленный в Draft Tray.
To create a text element with an arrow use the Draft Label command instead.
See also: Draft Tray and Draft Snap.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).
See also: Property editor.
A Draft Text object is derived from an App FeaturePython object and inherits all its properties. The following properties are additional unless otherwise stated.
Основные
Annotation
Enumeration
): specifies the annotation style applied to the text. See Draft AnnotationStyleEditor.Float
): specifies the general scaling factor applied to the text.Display Options
Enumeration
): specifies how the text is displayed. If it is World
the text will be displayed on a plane defined by its ДанныеPlacement. If it is Screen
the text will always face the screen. This is an inherited property. The mentioned options are the renamed options (introduced in version 0.21).Graphics
Color
): not used.Float
): not used.Text
См. так же: Draft API и Основы составления скриптов FreeCAD.
text = make_text(string, placement=None, screen=False)
Text
в point
, определённой как FreeCAD.Vector
.stringlist
это строка, или список строк, если это список, каждый элемент показывается в отдельной строке.screen
равен True
, текст всегда ориентируется в направлении просмотра камеры, иначе выравнивается по осям сцены и лежит в плоскости XY.The view properties of text
can be changed by overwriting its attributes; for example, overwrite ViewObject.FontSize
with the new size in millimeters.
Пример:
import FreeCAD as App
import Draft
doc = App.newDocument()
t1 = "This is a sample text"
p1 = App.Vector(0, 0, 0)
t2 = ["First line", "second line"]
p2 = App.Vector(1000, 1000, 0)
text1 = Draft.make_text(t1, p1)
text2 = Draft.make_text(t2, p2)
text1.ViewObject.FontSize = 200
text2.ViewObject.FontSize = 200
zaxis = App.Vector(0, 0, 1)
t3 = ["Upside", "down"]
p3 = App.Vector(-1000, -500, 0)
place3 = App.Placement(p3, App.Rotation(zaxis, 180))
text3 = Draft.make_text(t3, place3)
text3.ViewObject.FontSize = 200
doc.recompute()